home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-06 | 812 b | 49 lines | [TEXT/MSET] |
- (*
- We will use a ptrlist in class selwindow to dynamically allocate pointers
- to objects that we add: to the windows list of objects. We use Mike's
- class for this.
- *)
-
- :class PTRLIST super{ string sequence }
-
- :m ADD: \ ( ptr -- )
- pad ! pad 4 add: super ;m
-
- :m FIRST?:
- size: super nif false EXIT THEN \ No elements - return false
- reset: super ^1st: super @ true ;m
-
- :m NEXT?: \ ( -- ptr T | -- F )
- 4 skip: super len: super NIF false EXIT THEN
- ^1st: super @ true ;m
-
- ;class
-
- endload
-
- *** EXAMPLE USE
-
- ptrlist theList
-
- : go
- new: theList
-
- \ these aren't pointers that we're adding here
- \ but this will illustrate what is happening
- 12345 add: theList
- 67890 add: theList
- 33333 add: theList
- BEGIN
- each: theList
- WHILE
- ( item on stack )
- . cr
- REPEAT
- release: theList ;
-
-
-
-
-
-
-